package com.sghd.pojo.fight.game;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sghd.pojo.candy.fight.enums.Grade;

import java.util.HashMap;
import java.util.Map;

/**
 * @author frank
 * @date 2018-11-16 11:10
 * @desc
 **/
public class SettleVo extends Sn {
    /**房间类型*/
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private RoomType roomType;
    private Map<Long, DropVo> dropVoMap;
    /** 获胜方id*/
    private long winId;
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private ExitReason reason;

    /**PVE相关*/
    /**关卡编号*/
    private LevelVo level;
    /**星级评分*/
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private Grade grade;

    public RoomType getRoomType() {
        return roomType;
    }

    public void setRoomType(RoomType roomType) {
        this.roomType = roomType;
    }

    public Map<Long, DropVo> getDropVoMap() {
        return dropVoMap;
    }

    public void setDropVoMap(Map<Long, DropVo> dropVoMap) {
        this.dropVoMap = dropVoMap;
    }

    public long getWinId() {
        return winId;
    }

    public void setWinId(long winId) {
        this.winId = winId;
    }

    public ExitReason getReason() {
        return reason;
    }

    public void setReason(ExitReason reason) {
        this.reason = reason;
    }

    public LevelVo getLevel() {
        return level;
    }

    public void setLevel(LevelVo level) {
        this.level = level;
    }

    public Grade getGrade() {
        return grade;
    }

    public void setGrade(Grade grade) {
        this.grade = grade;
    }

    /**结算数据*/
    public static SettleVo valueOf(RoomType roomType, long sn, long winId, ExitReason exitReason) {
        SettleVo vo = new SettleVo();
        vo.sn = sn;
        vo.roomType = roomType;
        vo.winId = winId;
        vo.dropVoMap = new HashMap<>();
        vo.reason = exitReason;
        vo.grade = Grade.ZERO;
        return vo;
    }
}
